<?php
    header("Access-Control-Allow-Origin:*");
    $id = $_GET['id'];
    $name = $_GET['name'];
    $site = $_GET['address'];
    $tele = $_GET['tele'];
    
    $con = mysqli_connect('localhost','root','hl0319');

    mysqli_select_db($con,'shuffling');

    mysqli_query($con,"set charset 'utf8'");
    mysqli_query($con,"set character set 'utf8'");

    $sql = "update address set username='$name',tele='$site',tele='$tele' where Id=$id";
    
    $res = mysqli_query($con,$sql);

    if($res){
        echo json_encode(array(
            "code" => 200,
            "body" => array(
                "msg" => "修改成功"
            )
        ));
    }else{
        echo json_encode(array(
            "code" => 0,
            "body" => array(
                "msg" => "网络错误请重试"
            )
        ));
    }

?>